package tech.jabari.user.controller;

import tech.jabari.user.service.UserService;
import tech.jabari.user.service.impl.UserServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

import static tech.jabari.constants.UMSConstant.ACCESS_DENY_URL;

@WebServlet("/userDetail.action")
public class UserDetailServlet extends HttpServlet {

    private UserService userService = new UserServiceImpl();

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String id = request.getParameter("id");

        // 根据id查询用户信息。
        String userDtl = userService.findUserById(id);
        response.getWriter().write(userDtl);
    }
}
